<ui:composition template="template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core">
    <ui:define name="conteudo">
        <h:form>


            <h2>Cadastro de fotos</h2><br />
            Descrição:<br/>
            <h:inputTextarea id="descricaoFoto" value="#{formFotos.fotos.descricao}" required="true" requiredMessage="Digite a descrição da foto" />
            <br/><br/>
            Selecione o album:<br />
            <h:selectOneMenu id="nomeAlbum" value="#{formFotos.fotos.albuns}" converter="albumConverter">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{formFotos.listaAlbuns}" />
            </h:selectOneMenu>
            <br/><br/>
                <rich:fileUpload fileUploadListener="#{formFotos.listener}"
                                 id="upload"  acceptedTypes="jpg, gif, png, bmp">
                </rich:fileUpload>
            <br/><br/>
            <h:commandButton type="submit" value="Criar" action="#{formFotos.save}" />
            <h:commandButton type="reset" value="Limpar" />
        </h:form>
    </ui:define>
</ui:composition>